home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 3_2004-2005.ISO / Data / Zips / [M-Paint_3185906312005.psc / frmBrush.frm < prev    next >
Text File  |  2004-05-28  |  10KB  |  277 lines

  1. VERSION 5.00
  2. Begin VB.Form frmBrush 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Brush Editor"
  5.    ClientHeight    =   4320
  6.    ClientLeft      =   45
  7.    ClientTop       =   435
  8.    ClientWidth     =   2520
  9.    Icon            =   "frmBrush.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4320
  15.    ScaleWidth      =   2520
  16.    Begin VB.Frame Frame1 
  17.       Height          =   4215
  18.       Left            =   0
  19.       TabIndex        =   0
  20.       Top             =   0
  21.       Width           =   2415
  22.       Begin VB.CommandButton ClearBrush 
  23.          Caption         =   "Clear Current Brush"
  24.          Height          =   495
  25.          Left            =   120
  26.          TabIndex        =   16
  27.          Top             =   1320
  28.          Width           =   2175
  29.       End
  30.       Begin VB.Frame Frame3 
  31.          Caption         =   "Transparent Color"
  32.          Height          =   1095
  33.          Left            =   120
  34.          TabIndex        =   11
  35.          Top             =   3000
  36.          Width           =   2175
  37.          Begin VB.PictureBox Transparent 
  38.             BackColor       =   &H00FFFFFF&
  39.             Height          =   735
  40.             Left            =   120
  41.             ScaleHeight     =   675
  42.             ScaleWidth      =   675
  43.             TabIndex        =   15
  44.             ToolTipText     =   "RGB(255,255,255)"
  45.             Top             =   240
  46.             Width           =   735
  47.          End
  48.          Begin VB.HScrollBar tb 
  49.             Height          =   255
  50.             Left            =   840
  51.             Max             =   255
  52.             TabIndex        =   14
  53.             Top             =   720
  54.             Value           =   255
  55.             Width           =   1215
  56.          End
  57.          Begin VB.HScrollBar tg 
  58.             Height          =   255
  59.             Left            =   840
  60.             Max             =   255
  61.             TabIndex        =   13
  62.             Top             =   480
  63.             Value           =   255
  64.             Width           =   1215
  65.          End
  66.          Begin VB.HScrollBar tr 
  67.             Height          =   255
  68.             Left            =   840
  69.             Max             =   255
  70.             TabIndex        =   12
  71.             Top             =   240
  72.             Value           =   255
  73.             Width           =   1215
  74.          End
  75.       End
  76.       Begin VB.Frame Frame2 
  77.          Caption         =   "Editing Color"
  78.          Height          =   1095
  79.          Left            =   120
  80.          TabIndex        =   6
  81.          Top             =   1920
  82.          Width           =   2175
  83.          Begin VB.PictureBox color 
  84.             BackColor       =   &H00000000&
  85.             Height          =   735
  86.             Left            =   120
  87.             ScaleHeight     =   675
  88.             ScaleWidth      =   675
  89.             TabIndex        =   10
  90.             ToolTipText     =   "RGB(0,0,0)"
  91.             Top             =   240
  92.             Width           =   735
  93.          End
  94.          Begin VB.HScrollBar b 
  95.             Height          =   255
  96.             Left            =   840
  97.             Max             =   255
  98.             TabIndex        =   9
  99.             Top             =   720
  100.             Width           =   1215
  101.          End
  102.          Begin VB.HScrollBar g 
  103.             Height          =   255
  104.             Left            =   840
  105.             Max             =   255
  106.             TabIndex        =   8
  107.             Top             =   480
  108.             Width           =   1215
  109.          End
  110.          Begin VB.HScrollBar r 
  111.             Height          =   255
  112.             Left            =   840
  113.             Max             =   255
  114.             TabIndex        =   7
  115.             Top             =   240
  116.             Width           =   1215
  117.          End
  118.       End
  119.       Begin VB.Frame Frame4 
  120.          Caption         =   "Brush"
  121.          Height          =   1095
  122.          Left            =   120
  123.          TabIndex        =   4
  124.          Top             =   120
  125.          Width           =   975
  126.          Begin VB.PictureBox picBrush 
  127.             AutoRedraw      =   -1  'True
  128.             BackColor       =   &H00FFFFFF&
  129.             FillStyle       =   0  'Solid
  130.             Height          =   735
  131.             Left            =   120
  132.             ScaleHeight     =   45
  133.             ScaleMode       =   3  'Pixel
  134.             ScaleWidth      =   45
  135.             TabIndex        =   5
  136.             Top             =   240
  137.             Width           =   735
  138.          End
  139.       End
  140.       Begin VB.ComboBox PenSize 
  141.          Height          =   315
  142.          ItemData        =   "frmBrush.frx":08CA
  143.          Left            =   1200
  144.          List            =   "frmBrush.frx":08EC
  145.          TabIndex        =   3
  146.          Text            =   "1"
  147.          Top             =   240
  148.          Width           =   1095
  149.       End
  150.       Begin VB.OptionButton Pen 
  151.          Caption         =   "Pen"
  152.          Height          =   255
  153.          Left            =   1200
  154.          Style           =   1  'Graphical
  155.          TabIndex        =   2
  156.          Top             =   600
  157.          Value           =   -1  'True
  158.          Width           =   1095
  159.       End
  160.       Begin VB.OptionButton FloodFill 
  161.          Caption         =   "Flood Fill"
  162.          Height          =   255
  163.          Left            =   1200
  164.          Style           =   1  'Graphical
  165.          TabIndex        =   1
  166.          Top             =   960
  167.          Width           =   1095
  168.       End
  169.    End
  170. End
  171. Attribute VB_Name = "frmBrush"
  172. Attribute VB_GlobalNameSpace = False
  173. Attribute VB_Creatable = False
  174. Attribute VB_PredeclaredId = True
  175. Attribute VB_Exposed = False
  176. Option Explicit
  177. Dim oldx
  178. Dim oldy
  179. Private Sub exit_Click()
  180. End
  181. End Sub
  182.  
  183. '################################ BRUSH EDIT #################################
  184.  
  185. Private Sub PenSize_Change()
  186. If PenSize.Text > 20 Then
  187. PenSize.Text = 20
  188. MsgBox "Size Must Be Between 1 And 20", vbCritical, "Brush Editor"
  189. End If
  190. If PenSize.Text <= 0 Then
  191. PenSize.Text = 1
  192. MsgBox "Size Must Be Between 1 And 20", vbCritical, "Brush Editor"
  193. End If
  194. picBrush.DrawWidth = PenSize.Text
  195. End Sub
  196.  
  197. Private Sub picBrush_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  198.     If Button = 1 Then
  199.         If Pen.Value = True Then
  200.             picBrush.Line (X, Y)-(X, Y), color.BackColor
  201.         End If
  202.         If FloodFill.Value = True Then
  203.             picBrush.FillStyle = 0
  204.             ExtFloodFill picBrush.hdc, X, Y, picBrush.Point(X, Y), 1
  205.         End If
  206.     End If
  207. End Sub
  208. Private Sub picBrush_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  209. Dim xR, xG, xB
  210.     xR = picBrush.Point(X, Y) And 255
  211.     xG = (picBrush.Point(X, Y) And 65280) / 256
  212.     xB = (picBrush.Point(X, Y) And 16711680) / 65535
  213.     picBrush.ToolTipText = "RGB(" & xR & "," & xG & "," & Int(xB) & ")"
  214.     picBrush.FillColor = RGB(r.Value, g.Value, b.Value)
  215.     picBrush.DrawWidth = PenSize.Text
  216.     If Button = 1 Then
  217.         If Pen.Value = True Then
  218.             picBrush.Line (oldx, oldy)-(X, Y), color.BackColor
  219.         End If
  220.     End If
  221.     oldx = X
  222.     oldy = Y
  223. End Sub
  224. '################################# COLOR MIXERS ########################################
  225. '[EDIT COLOR]
  226. Private Sub r_Change()
  227. color.ToolTipText = "RGB(" & r.Value & "," & g.Value & "," & b.Value & ")"
  228. color.BackColor = RGB(r.Value, g.Value, b.Value)
  229. End Sub
  230. Private Sub b_Change()
  231. color.ToolTipText = "RGB(" & r.Value & "," & g.Value & "," & b.Value & ")"
  232. color.BackColor = RGB(r.Value, g.Value, b.Value)
  233. End Sub
  234. Private Sub g_Change()
  235. color.ToolTipText = "RGB(" & r.Value & "," & g.Value & "," & b.Value & ")"
  236. color.BackColor = RGB(r.Value, g.Value, b.Value)
  237. End Sub
  238. Private Sub r_Scroll()
  239. color.ToolTipText = "RGB(" & r.Value & "," & g.Value & "," & b.Value & ")"
  240. color.BackColor = RGB(r.Value, g.Value, b.Value)
  241. End Sub
  242. Private Sub g_Scroll()
  243. color.ToolTipText = "RGB(" & r.Value & "," & g.Value & "," & b.Value & ")"
  244. color.BackColor = RGB(r.Value, g.Value, b.Value)
  245. End Sub
  246. Private Sub b_Scroll()
  247. color.ToolTipText = "RGB(" & r.Value & "," & g.Value & "," & b.Value & ")"
  248. color.BackColor = RGB(r.Value, g.Value, b.Value)
  249. End Sub
  250. '[TRANSPARENT COLOR]
  251. Private Sub tr_Change()
  252. Transparent.ToolTipText = "RGB(" & tr.Value & "," & tg.Value & "," & tb.Value & ")"
  253. Transparent.BackColor = RGB(tr.Value, tg.Value, tb.Value)
  254. End Sub
  255. Private Sub tb_Change()
  256. Transparent.ToolTipText = "RGB(" & tr.Value & "," & tg.Value & "," & tb.Value & ")"
  257. Transparent.BackColor = RGB(tr.Value, tg.Value, tb.Value)
  258. End Sub
  259. Private Sub tg_Change()
  260. Transparent.ToolTipText = "RGB(" & tr.Value & "," & tg.Value & "," & tb.Value & ")"
  261. Transparent.BackColor = RGB(tr.Value, tg.Value, tb.Value)
  262. End Sub
  263. Private Sub tr_Scroll()
  264. Transparent.ToolTipText = "RGB(" & tr.Value & "," & tg.Value & "," & tb.Value & ")"
  265. Transparent.BackColor = RGB(tr.Value, tg.Value, tb.Value)
  266. End Sub
  267. Private Sub tg_Scroll()
  268. Transparent.ToolTipText = "RGB(" & tr.Value & "," & tg.Value & "," & tb.Value & ")"
  269. Transparent.BackColor = RGB(tr.Value, tg.Value, tb.Value)
  270. End Sub
  271. Private Sub tb_Scroll()
  272. Transparent.ToolTipText = "RGB(" & tr.Value & "," & tg.Value & "," & tb.Value & ")"
  273. Transparent.BackColor = RGB(tr.Value, tg.Value, tb.Value)
  274. End Sub
  275.  
  276.  
  277.